<!--
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-05-25 15:28:04
 * @LastEditors: Jun
 * @LastEditTime: 2021-05-25 16:20:38
-->
<template>
  <div class="pagination">
    <el-pagination
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-size="size"
      layout="total, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      //总条数
      type: Number,
      default: 10,
    },
    size: {//每页条数
      type: Number,
      default: 10,
    },
    currentPage:{//当前页
        type:Number,
        default:1
    }
  },
  model:{
      prop:"currentPage",
      event:"change"
  },
  methods: {
    handleCurrentChange(idx) {
      this.$emit("change",idx);
    },
  },
};
</script>

<style lang="scss" scoped>
.pagination {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
</style>